]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
appDisplay: Use _getCategories function instead of duplicating the code
authorJonas Dreßler <verdre@v0yd.nl>
Thu, 31 Oct 2019 23:19:38 +0000 (00:19 +0100)
committerFlorian Müllner <florian.muellner@gmail.com>
Thu, 5 Dec 2019 15:43:34 +0000 (15:43 +0000)
We already have a function which gets the categories of an app and
handles the null-return case, use it.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/799

js/ui/appDisplay.js

index 3b70cd5c0e859ba5f8e2026eaacae883f9807f1a..8960f6fa8e339af8c6a9941d2232922a3a13cd35 100644 (file)
@@ -102,10 +102,7 @@ function _findBestFolderName(apps) {
     let commonCategories = [];
 
     appInfos.reduce((categories, appInfo) => {
-        const appCategories = appInfo.get_categories();
-        if (!appCategories)
-            return categories;
-        for (let category of appCategories.split(';')) {
+        for (let category of _getCategories(appInfo)) {
             if (!(category in categoryCounter))
                 categoryCounter[category] = 0;